﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

@using dPet.Application.DataObjects;

@model  dPet.Web.Admin.ViewModels.StaffModel

<div class="clearfix">
	<h4>编辑员工信息</h4>

	<hr />

	@using (Html.BeginForm("SaveStaff", "Manage", FormMethod.Post, new { id = "save_staff_form" }))
	{
		<div class="panel panel-default">
			<div class="panel-heading">
				<button id="btn_cancel" type="button" class="btn btn-sm btn-default" onclick="window.history.go(-1);"><span class="glyphicon glyphicon-chevron-left"></span> 返 回</button>
				<button id="btn_submit" type="submit" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-floppy-disk"></span> 保 存</button>
			</div>

			<div class="panel-body form-horizontal">
				@Html.Hidden("Id", Model.Staff.Id)
				@Html.Hidden("HospitalId", Model.Staff.HospitalId)

				<div class="form-group">
					<label for="Name" class="col-md-1 control-label">姓　　名</label>
					<div class="col-md-3">
						@Html.TextBox("Name", Model.Staff.Name, new { @class = "form-control", placeholder = "请输入姓名" })
					</div>
				</div>

				<div class="form-group">
					<label for="Contact" class="col-md-1 control-label">联系方式</label>
					<div class="col-md-3">
						@Html.TextBox("Contact", Model.Staff.Contact, new { @class = "form-control", placeholder = "请输入联系方式" })
					</div>
				</div>

				<div class="form-group">
					<label for="StaffRole" class="col-md-1 control-label">角　　色</label>
					<div class="col-md-3">
						@Html.DropDownList("StaffRole.Id", new SelectList(Model.StaffRoles, "Id", "Name", Model.Staff.StaffRole.Id), new { @class = "form-control" })
					</div>
				</div>
			</div>
		</div>
	}
</div>

@section scripts {

	<script type="text/javascript">
		$("#btn_submit").bind("click", function () {
			$("#save_staff_form").submit();
		});
	</script>
}
